Ext.define('UM.view.SelectThemePanel',
{
    extend : 'Ext.container.Container',
    alias : 'widget.selectThemesPanel',
    layout :
    {
        type : 'vbox',
        align : 'left'
    },
    margin : 10,
    items :
    [
        {
            xtype : 'combo',
            itemId : 'themesComboId',
            emptyText : 'Select theme',
            queryMode : 'local',
            value : 'classic',
            allowBlank : false,
            forceSelection : true,
            editable : false,
            fieldLabel : 'Select Portal theme',
            labelWidth : 150,
            displayField : 'name',
            margin : 5,
            //            width : 207,

            store : Ext.create('Ext.data.Store',
            {
                autoDestroy : true,
                fields :
                [
                    'name'
                ],

                data : []
            }),
            listeners :
            {
                afterrender : function(thiz)
                {}
            }
        }
    ],

    setEditObj : function(themes)
    {
        debugger
        var me = this;
        var combo = me.down('#themesComboId');
        combo.store.loadRawData(themes);
        var el = Ext.dom.Query.select('link[@id="extTheme"]')[0];
        var href = el.getAttribute('href');
        var start = href.lastIndexOf('/');
        var stop = href.lastIndexOf('.css');
        var theme = href.substring(start + 1, stop);
        combo.setValue(theme);
    }
});